import type { Action } from '../actions/types'
import { FOOTER_TAB_PRESS } from '../actions/footer'

export type State = {
  currentTab: string
}

const initialState = {
  currentTab: 'tab1',
}

export default function (state:State = initialState, action:Action): State {
  if (action.type === FOOTER_TAB_PRESS) {
    return {
      ...state,
      currentTab: action.payload
    }
  }
  return state
}
